

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

     <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
     <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
            .checkbox-inline input[type=checkbox],.radio-inline input[type=radio] {
    margin-top: 4px;
}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
        <h2 class="title_color text-center">省份营销费用报表</h2>
    </div>
    <!-- 标题 -->
    <div>
     <form action="{:url('query')}"  class="form-inline" id="f1">
      <table class="tab-content table-bordered  table" border="1" style="margin-bottom:1px">
          <tr>
          <td>
           <select name="cid" id="cid" class="select form-control">
                 {volist name="cainian" id="c"}
                  <option value="{$c.id}" {if $cid==$c.id} selected {/if}>{$c.title}</option>
                 {/volist}
          </select>
			<span class="lr_5"></span>
            <div class="form-group">
               <label class="radio-inline" for="formalFx">
                    <input type="radio" checked name="fx_kind" id="chang" value="1">常规分析
               </label>
               <label class="radio-inline" for="kind_zb">
                 <input type="radio" name="fx_kind" id="kemus"  value="2">各费用科目占比
               </label>
                      
            </div>
			</td>
      </tr>
      <tr id="fenqu">
          <td>
            <div class="form-group">
              
               {volist name="fenqu" id="f"}
                   <span class="checkDiv">
                      <label class="checkbox-inline" for="dndq">
                    <input type="checkbox" name="sheng[]" class="fenqu" value="{$f.id}">{$f.title}
                </label>
                </span>
              {/volist}

                
                 <button class="btn-info btn" type="button" id="checkAll">全选</button>
                   <button class="btn-info btn" type="button" id="cancelCheckAll">取消全选</button>
            </div>
          </td>
      </tr>
      <tr id="kind_lx" style="display: none;">
         <td>
            <div class="form-group">
                   {volist name="kemu" id="k"}
                  <span class="checkDiv">
                    <label class="checkbox-inline" for="dtf">
                         <input type="checkbox" name="kemu[]" class="kemu"   value="{$k.id}">{$k.title}
                    </label>
                  </span>
                {/volist}
                 <button class="btn-info btn" type="button" id="checkAll1">全选</button>
                 <button class="btn-info btn" type="button" id="cancelCheckAll1">取消全选</button>
            </div>
          </td>
      </tr>
      </table>
   
     <div class="padding-10 text-center">
           <button class="btn btn-info" type="submit">查询</button>
     </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
      <script src="__STATIC__/layout/js/common.js"></script>

    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script>
       $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
             });
   /*常规分析 各费用占比*/
        $("[name='fx_kind']").change(function(){
          if($("#chang").prop("checked")){
            $("#kind_lx").hide();
          }else{
            $("#kind_lx").show();
          }
        })
        /*fenqu全选*/
           $("#checkAll").click(function(){
      
               $(".fenqu").prop("checked",true);
           })
           /*fenqu取消全选*/
          $("#cancelCheckAll").click(function(){
            $(".fenqu").prop("checked",false)
           
           })


           /*kind_lx全选*/
              $("#checkAll1").click(function(){
      
               $(".kemu").prop("checked",true);
           })
           /*kind_lx取消全选*/
             $("#cancelCheckAll1").click(function(){
            $(".kemu").prop("checked",false)
           
           })

             /*查询*/
              /*$(".query").click(function(){
           
                    if($('input[name=items]').prop("checked")!=true){
                      alert("请选择分区！")
                    }else if($('input[name=items]:checked').length<1){
                       alert("请选择费用科目！")
                    }else{
                        location.href="{:url('Other/fq_yx_costb_query')}"
                    }
             
                }); */
              //查询验证
              document.getElementById("f1").onsubmit=function(){
                if($(".fenqu:checked").length==0){
                  swal("请至少选择一个省份")
                  return false;
                }
                if($("#kemus").prop("checked")){
                  if($(".kemu:checked").length==0){
                    swal("请至少选择一个科目")
                    return false;
                  }
                }else{
                   $(".kemu").prop("checked",false)
                }
              }
    </script>
</body>

</html>
